home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright © 1991-1995 by TopSoft Inc. All rights reserved.
-
- You may distribute this file under the terms of the TopSoft
- Artistic License, accompanying this package.
-
- This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
- See the Modification History for more details.
-
- Product
- About Box
-
- FILE
- ABUEnvQuickTime.c
-
- NAME
- ABUEnvQuickTime.c, part of the ABox project source code,
- responsible for mix-in handling the AboutBox quicktime environment stuff.
-
- DESCRIPTION
- This file contains defines for the about box modules.
-
- DEVELOPED BY
- George (ty) Tempel netromancr@aol.com
- All code in this file, and its associated header file was
- Created by George (ty) Tempel in connection with the TopSoft, Inc.
- "FilterTop" application development, except where noted.
-
- CARETAKER - George (ty) Tempel <netromancr@aol.com>
- Please consult this person for any changes or suggestions to this file.
-
- MODIFICATION HISTORY
-
- dd mmm yy - xxx - patchxx: description of patch
- 10 June 94 - ty - Initial Version Created
- 20-july-94 - ty - initial version released
- 23-may-95 - ty - changes for compatibility with the CodeWarrior CW6
- release and the associated Universal Headers from Apple:
- most methods that returned references now have "Ref" at
- the end of their methods names to prevent possible collisions
- with datatypes and classes of the same name (older versions
- of the compiler didn't have a problem with this).
-
- */
-
- /*===========================================================================*/
-
- /*======= Segmentation directives ========*/
-
- #ifdef USE_MANUAL_SEGMENTATION
- #pragma segment ty
- #endif
-
- /*============ Header files ==============*/
-
- #include "ABUEnvQuickTime.h"
-
- /*=============== Globals ================*/
-
- #define kABstopMovieController ((void *)0)
-
- /*================ CODE ==================*/
-
-
- /*=============================== ABUEnvQuickTime::ABUEnvQuickTime ================================*/
- ABUEnvQuickTime::ABUEnvQuickTime(void)
- {
- mController = NULL;
- mMovie = NULL;
- } // end ABUEnvQuickTime
-
-
- /*=============================== ABUEnvQuickTime::~ABUEnvQuickTime ================================*/
- ABUEnvQuickTime::~ABUEnvQuickTime(void)
- {
- this->Close();
- } // end ~ABUEnvQuickTime
-
-
-
- /*=============================== ABUEnvQuickTime::IsPresent ================================*/
- Boolean ABUEnvQuickTime::IsPresent(void)
- {
- if (this->CheckGestalt(gestaltQuickTime) == noErr)
- {
- this->IndicatorRef() = true;
- } else {
- this->IndicatorRef() = false;
-
- } // end if block
- return this->IndicatorRef();
- } // end IsPresent
-
-
-
- /*=============================== ABUEnvQuickTime::Feature ================================*/
- Boolean ABUEnvQuickTime::Feature(long mask)
- {
- return (this->ResultRef() & mask);
- } // end Feature
-
-
- /*=============================== ABUEnvQuickTime::Initialize ================================*/
- OSErr ABUEnvQuickTime::Initialize(void)
- {
- if (!this->IsPresent())
- return noErr;
-
- return ::EnterMovies();
- } // end Initialize
-
-
-
- /*=============================== ABUEnvQuickTime::Close ================================*/
- OSErr ABUEnvQuickTime::Close(void)
- {
- OSErr error = noErr;
-
- if (!IsPresent())
- return noErr;
-
- this->CleanUp();
-
- //ExitMovies();
-
- this->CheckedRef() = false;
- this->IndicatorRef() = false;
- this->ResultRef() = 0;
-
- return error;
- } // end Close
-
-
-
- /*=============================== ABUEnvQuickTime::CleanUp ================================*/
- void ABUEnvQuickTime::CleanUp(void)
- {
- OSErr error = noErr;
-
- if (! this->IsPresent())
- return;
-
- this->End();
- if (this->HasController())
- {
- ::CloseComponent(this->MovieControllerRef());
- this->MovieControllerRef() = NULL;
- }
-
- if (this->HasMovie())
- {
- ::DisposeMovie(this->MovieRef());
- this->MovieRef() = NULL;
- }
-
- error = ::GetMoviesError();
-
- return;
- } // end CleanUp
-
-
-
-
- /*=============================== ABUEnvQuickTime::Begin ================================*/
- OSErr ABUEnvQuickTime::Begin(void)
- {
- OSErr error = noErr;
-
- if (!this->IsPresent())
- return error;
- else if (this->DoesntHaveMovie())
- return error;
-
- ::ShowMoviePoster(this->MovieRef()); // 1.0a3 ty ...added to show the poster frame
- error = ::GetMoviesError();
-
- if (this->DoesntHaveController())
- { // 1.0a3 ty ... additions for movie controller support
- //
- // we had problems creating the controller, so let's just
- // show the movie as it stands.
- //
-
- // now play
- //
- ::GoToBeginningOfMovie(this->MovieRef());
- error = ::GetMoviesError();
- if (error)
- {
- this->CleanUp ();
- return (error);
- } // end if block
-
-
- error = ::PrerollMovie (this->MovieRef(), 0, 0);
- if (error)
- {
- this->CleanUp ();
- return (error);
- } // end if block
-
- ::SetMovieActive (this->MovieRef(), true);
- error = ::GetMoviesError();
- if (error)
- {
- this->CleanUp ();
- return (error);
- } // end if block
-
- ::StartMovie(this->MovieRef() = this->MovieRef());
- error = ::GetMoviesError();
- if (error)
- {
- this->CleanUp ();
- return (error);
- } // end if block
-
- while (!::IsMovieDone(this->MovieRef()))
- ::MoviesTask(this->MovieRef(), (long)0);
-
- } // end if block...
-
- return error;
- } // end Begin
-
-
-
-
- /*=============================== ABUEnvQuickTime::End ================================*/
- OSErr ABUEnvQuickTime::End(void)
- {
- OSErr error = noErr;
- ComponentResult componentResult;
-
- if (! this->IsPresent())
- return error;
-
- if (this->HasController())
- {
- // 1.0a3 patch ty ... added MCDoAction(0) to stop the controller dead in its tracks
- componentResult = ::MCDoAction(this->MovieControllerRef(), mcActionPlay, kABstopMovieController); // rate=zero to stop
- } // end if block
-
- if (this->HasMovie())
- {
- // 1.0a3 patch ty ... added StopMovie(gTheMovie) to stop the movie dead in its tracks
- ::StopMovie(this->MovieRef());
- } // end if block
-
- error = ::GetMoviesError();
-
-
- return error;
- } // end End
-
-
-
-
-